window: Allow unsetting custom titlebar
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Fri, 10 Jan 2014 20:25:27 +0000 (15:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jan 2014 22:52:06 +0000 (17:52 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=720059

gtk/gtkwindow.c

index f34f943e647df100ec97a0f8cc4f32c51efa0dad..1b0ad7b96093c1738c93260692181cdddd7553ad 100644 (file)
@@ -3615,7 +3615,7 @@ on_titlebar_title_notify (GtkHeaderBar *titlebar,
 /**
  * gtk_window_set_titlebar:
  * @window: a #GtkWindow
- * @titlebar: the widget to use as titlebar
+ * @titlebar: (allow-none): the widget to use as titlebar
  *
  * Sets a custom titlebar for @window.
  *
@@ -3639,6 +3639,13 @@ gtk_window_set_titlebar (GtkWindow *window,
 
   unset_titlebar (window);
 
+  if (titlebar == NULL)
+    {
+      priv->custom_title = FALSE;
+      priv->client_decorated = FALSE;
+      return;
+    }
+
   if (gdk_window_supports_csd (window))
     gdk_window_enable_csd (window);
   else